<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>Hello MUI</title>
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">

		<link rel="stylesheet" href="/weixin/css/mui.min.css">
		<style type="text/css">
		.lmj-article{
			text-indent: 2em;
			color: #000000;
			font-size: 17px;
		}
		.lmj-nav-input{
			width: 7% !important;
		}
		.lmj-nav-input>input {
		    margin-bottom: 0px;
		    margin-left: 5px;
		    width: 98%;
		}
		#infoContentL img{
			max-width: 100%;
	   		height: auto;
		}
		.lmj-article img{
			width: 80%;
		}
		</style>
	</head>
	<body>
		<header class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 id="title" class="mui-title">资讯详情</h1>
		</header>
		<nav class="mui-bar mui-bar-tab">
			<a class="mui-tab-item lmj-nav-input lmj-nav-a" href="comment.html">
				<input type="text" placeholder="我有话说..."/>
			</a>
			<a class="mui-tab-item lmj-nav-a" href="comment.html">
				<!--<span class="mui-icon mui-icon-chatbubble"><span class="mui-badge">9</span></span>-->
				<span class="mui-icon mui-icon-chatbubble"></span>
			</a>
			<!--<a id="shareBtnL" class="mui-tab-item" href="javascript:;">
				<span class="mui-icon mui-icon-redo"></span>
			</a>-->
		</nav>
		<div class="mui-content" id="infoDetailsContent">
			<div class="mui-content-padded">
				<h3 id="infoHeaderL"></h3>
				<p id="infoPubTimeL"></p>
				<article class="lmj-article" id="infoContentL"></article>
			</div>
		</div>
	</body>
	<script src="/weixin/js/mui.min.js"></script>
	<script src="/weixin/js/jquery.min.js"></script>
	<script>
		mui.init();
		
		mui.plusReady(function(){
			var self=plus.webview.currentWebview();
			    infoId=self.infoId;
			mui.ajax('http://mwx.chinatoplady.cn/wx/portal/detail',{
				data:{
					id:infoId
				},
				type:'get',
				timeout:10000,
				success:function(data){
					jQuery("#infoHeaderL").html(data.title);
					jQuery("#infoPubTimeL").html(data.updateTime);
					var imageUrl=data.image;
					if(imageUrl.indexOf("http")>0){
						jQuery("#infoImgL").attr("src",data.image);
					}else{
						jQuery("#infoImgL").attr("src","http://mstatic.chinatoplady.cn/upload"+data.image);
					}
					jQuery("#infoContentL").html(data.content);
				},
				error:function(xhr,type,errorThrown){
					jQuery("#infoDetailsContent").html("您找的页面不见啦");
					console.log(xhr);
					console.log(type);
					console.log(errorThrown);
				}
			});
		});
		
		var aniShow = "slide-in-right";
		//关于backbutton和menubutton两个按键的说明，在iOS平台不存在，故需隐藏
		if(!mui.os.android){
			aniShow = "pop-in";
		}
		
		$(".lmj-nav-a").bind("tap",function() {
			var id = this.getAttribute("href");
			var href = this.href;
			var webview_style = {
				popGesture: "close"
			};
			mui.openWindow({
				id: id,
				url: href,
				styles: webview_style,
				extras:{
					"infoId":infoId
				},
				show: {
					aniShow: aniShow
				},
				waiting: {
					autoShow: false
				}
			});
		});
	</script>
</html>